void portal(Player @player, Portal @portal) {
    int map = player.getVariable("fm_map");
    if (map == -1){
        player.changeMap(100000000);
    } else {
        int portal = player.getVariable("fm_portal");
        if (portal == -1)
            portal = 0;
        player.changeMap(map, portal);
        player.deleteVariable("fm_map");
        player.deleteVariable("fm_portal");
    }
}